<#import '/ftlLibrary/properteisVariable.ftl' as pv/>

<div class="row" style="margin: 0 1px;">
    <p class="text-right" style="padding: 20px 0;margin: 0;">会员王华华，可选课课时数：22课时</p>
    <div class="panel-group" id="accordion">
        <div class="panel panel-info">
            <div class="panel-heading">
                <h4 class="panel-title">
                    <a data-toggle="collapse" data-parent="#accordion"
                       href="#collapseOne" style="display: block">
                        萌宝爱阅读 / 1号教室 / 丽丽老师
                    </a>
                </h4>
            </div>
            <div id="collapseOne" class="panel-collapse collapse">
                <div class="panel-body">
                    <p class="text-center">课程日期：3月1日-6月1日9:00-9:45，周二 课程节数：12节 单节消耗课时数：2</p>
                    <form class="bs-example bs-example-form" role="form">
                        <div class="row">
                            <div class="btn-toolbar" role="toolbar" style="margin: 10px;">
                                <div class="btn-group">
                                    <button type="button" class="btn btn-default"><input type="checkbox" style="position: static;opacity: 1;margin: 0;width: 12px;height: 12px;margin: 3px 0;"></button>
                                    <button type="button" class="btn btn-default disabled">01</button>
                                    <button type="button" class="btn btn-default disabled">2017年03月01日</button>
                                    <button type="button" class="btn btn-default disabled">周二</button>
                                </div>
                                <div class="btn-group">
                                    <button type="button" class="btn btn-default"><input type="checkbox" style="position: static;opacity: 1;margin: 0;width: 12px;height: 12px;margin: 3px 0;"></button>
                                    <button type="button" class="btn btn-default disabled">01</button>
                                    <button type="button" class="btn btn-default disabled">2017年03月01日</button>
                                    <button type="button" class="btn btn-default disabled">周二</button>
                                </div>
                                <div class="btn-group">
                                    <button type="button" class="btn btn-default"><input type="checkbox" style="position: static;opacity: 1;margin: 0;width: 12px;height: 12px;margin: 3px 0;"></button>
                                    <button type="button" class="btn btn-default disabled">01</button>
                                    <button type="button" class="btn btn-default disabled">2017年03月01日</button>
                                    <button type="button" class="btn btn-default disabled">周二</button>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="btn-toolbar" role="toolbar" style="margin: 10px;">
                                <div class="btn-group">
                                    <input type="checkbox" style="position: static;opacity: 1;margin: 0;width: 12px;height: 12px;margin: 3px 0;"> 全选
                                    <span>可选课时数不足，请购买或激活其他课时包</span>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <div class="col-sm-12 text-align-center">
        <button style="width: 80px;margin-right: 20px" type="button" class="btn btn-blue" data-dismiss="modal" serializeNum="${serializeNum}"
                targetdataId="${data.id}" onclick="showDialogAttendClass(this)">确定
        </button>
        <input style="width: 80px;" type="button" class="btn btn-blue" data-dismiss="modal" value="取消" />
    </div>
</div>



<script src="assets/js/validation/bootstrapValidator_init.js"></script>
<script>

    $(function () {
        $('#collapseOne').collapse('toggle')
    });


    $(".selectpicker_${serializeNum}").select2();

    function showDialigSaveAttendClass() {
        var memberPackageId = $(".memberPackageId").val();
        var allCheckVlaues = new Array();
        $("[name='clId']:checked").map(function (index, chk) {
            var value = chk.value;
            var values = new Array();
            $("[parentCheckId='clId_" + value + "']:checked").map(function (index, chek1) {
                values.push(chek1.value);
            });
            allCheckVlaues.push(value + ":" + values.join(","));
        });
        var allCheckVlauesStr = allCheckVlaues.join("|");
        console.log(allCheckVlauesStr);
        ajaxRequest("tssMemberAttendClassRecordController/saveOrUpdate.do", {
            targetDataId: allCheckVlauesStr,
            memberPackageId: memberPackageId
        }, function (html) {
            getTopWin().bootbox.dialog({
                message: html,
                title: "报班记录",
                className: 'myDialog'
            });

        }, function () {
            ajaxError("加载页面失败!")
        }, "post", "html")
    }


    /**
     * 获取指定复选框选中的值字符串
     * @param inputName 复选框name属性值,默认是id
     * @param separator 分隔符,默认为逗号
     * @returns {String} 复选框选中的值字符串
     */
    function getCheckedInputValuesClId(inputName, separator) {
        if (!inputName) {
            inputName = "clId";
        }
        if (!separator) {
            separator = ",";
        }
        var inputs = $("[name='" + inputName + "']:checked");
        var count = inputs.size();
        var values = "";
        for (var i = 0; i < count; i++) {
            values += inputs.eq(i).val();
            if (i != count - 1) {
                values += ",";
            }
        }
        return values;
    }
</script>